home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / GameCreators / TADS / manuals / TADSG.DOC < prev    next >
Encoding:
Text File  |  1993-02-16  |  47.8 KB  |  974 lines

  1. TADS/Graphic Beta Release Notes
  2. ===============================
  3.  
  4.  
  5. Introduction
  6. ------------
  7.  
  8. Thanks for participating in the TADS/Graphic beta test program!  We
  9. appreciate your help with our new product testing.  Our main goal for
  10. the beta test program is to find out what changes we need to make to
  11. TADS/Graphic before making it generally available.  As you use the
  12. software, please make notes of the problems you encounter and the
  13. features you'd like to see added or changed.  You should look for the
  14. following types of things in particular:
  15.  
  16.    - Bugs.  The most important goal of the beta test is ensuring
  17.      that the software works correctly.
  18.  
  19.    - Performance problems.  If you find situations where the system
  20.      seems to run too slowly, let us know what you're doing.
  21.  
  22.    - Missing features.  If you need a new feature in the system to
  23.      make it possible to implement some part of your game, let us
  24.      know what you're trying to accomplish and what support you'd
  25.      like from the system.
  26.  
  27.    - Changes to existing features.  If you find an existing feature
  28.      difficult or inconvenient to use, give us your suggestions for
  29.      improving it.
  30.  
  31.    - Documentation.  If you find parts of the documentation confusing
  32.      or incorrect, please suggest improvements or corrections.  If
  33.      you find information missing, let us know.  To some extent,
  34.      we'll be able to compile our own list of missing documentation
  35.      based on your questions, but it would help if you provided your
  36.      own list.
  37.  
  38.  
  39. TADS/Graphic Product Disposition
  40. --------------------------------
  41.  
  42. Please keep in mind that TADS/Graphic is *not* yet a product.  We
  43. hope to release TADS/Graphic as a product in the future, but we can't
  44. guarantee that this will happen.  We could, for example, decide that
  45. we want High Energy Software to devote itself to selling medical
  46. insurance, which would make TADS/Graphic somewhat incongruous with
  47. our corporate mission.  We could also decide that we want to be
  48. greedy and not let anyone use our great system to develop games that
  49. would compete with our own games.
  50.  
  51. In any case, we're hereby warning you that you must not construe
  52. this Beta program as a commitment by High Energy Software to release
  53. TADS/Graphic at any point in the future, or to anything else at all,
  54. for that matter.  Therefore, please do not base any personal or
  55. business plans on the existence of TADS/Graphic.  For example, please
  56. do not yet sell all of your personal possessions so that you can lead
  57. an existence devoid of any distractions from developing graphical
  58. adventure games with High Energy Software graphical adventure development
  59. systems.  Also, please do not enter into any contracts with Electronic
  60. Arts to deliver a graphical adventure game version of the Sports
  61. Illustrated Swimsuit Edition by June 1993 (at least, not if the
  62. contract is in some way predicated on the existence of TADS/Graphic at
  63. any point in time).  If you do any of these things, there's a good
  64. chance that you'll want to sue us when we decide not to release
  65. TADS/Graphic after all; we just want to make clear up front, for the
  66. purposes of defending ourselves at the inevitable legal proceedings,
  67. that we didn't say anything that would lead a reasonable person to
  68. believe that we really meant we'd make a product out of this pile of
  69. code.
  70.  
  71. Also, please note that we do not intend to make TADS/Graphic shareware.
  72. Furthermore, the Beta version is not only not shareware, it's actually
  73. not even a product!  It's a proprietary trade secret of High Energy
  74. Software.  Therefore, please do not give a copy of the beta software to
  75. anyone.  Treat it as you would your commercial software (actually, allow
  76. us to reword that:  treat it as the commercial software vendors want you
  77. to treat your commercial software -- but we're sure that's the same thing,
  78. so forget we mentioned it).
  79.  
  80. Note that when we say that the Beta version is a proprietary trade
  81. secret, we just mean the software.  We don't mind if you talk about it
  82. with other people, as long as you don't give anyone a copy.  In fact,
  83. we're going to release a demo game at some point, so we don't consider
  84. the existence and some of the details of the system as terribly secret.
  85. However, you shouldn't say anything to anyone that leads them to believe
  86. that we've made any kind of commitment to releasing TADS/Graphic as a
  87. product, for the reasons detailed above.
  88.  
  89.  
  90. Hardware Requirements
  91. ---------------------
  92.  
  93. TADS/Graphic requires an MS-DOS personal computer with 640k of
  94. memory (at least 512k available for programs).  You will also need
  95. a hard disk, although the amount of free space required is largely
  96. determined by the size of your game; you will most likely need at
  97. least 10 megabytes free prior to installing TADS/Graphic.
  98.  
  99. You must have at least an EGA display adaptor; VGA is strongly recommended.
  100. TADS/Graphic will run in the 640 x 350 16-color mode on EGA, but the
  101. limited palette available in EGA mode makes EGA less than optimal.
  102.  
  103. It is possible that future versions will support only VGA; already,
  104. the "title mode" is 320 x 200 x 256, which is available only on VGA
  105. and MCGA (and TADS/Graphic doesn't support MCGA because it doesn't
  106. provide a suitable 640 x 480 mode).  EGA also has a non-square aspect
  107. ratio (your pictures will be vertically stretched out, and the compass
  108. rose is a rather uncircular ellipse on EGA).
  109.  
  110. If you wish to play music and/or digitized effects, you must have a
  111. SoundBlaster or compatible sound card installed.
  112.  
  113.  
  114. What is TADS/Graphic?
  115. ---------------------
  116.  
  117. TADS/Graphic is a superset of TADS version 2.0 that lets you integrate
  118. graphics and sound effects with your games.  TADS/Graphic provides a
  119. new user interface that uses concepts familiar to users of GUI systems,
  120. and makes game play easier through use of a mouse.
  121.  
  122. However, TG (as we'll call TADS/Graphic from now on) is much more than
  123. a set of superficial improvements to the TADS run-time user interface.
  124. The pictures that you display are not simply fixed, static, inactive
  125. illustrations.  Pictures can change as the player performs actions that
  126. change the game state.  Pictures can be used as *input* devices as well:
  127. the objects depicted in a picture can be associated with objects in the
  128. game, allowing the player to refer to an object simply by pointing at
  129. it with the mouse and clicking.
  130.  
  131. Furthermore, the TG user interface features a revolutionary intelligent
  132. command builder.  Using the mouse, the player can enter commands simply
  133. by pointing at objects on the screen and selecting command buttons from
  134. a small, easily understood set of basic commands.  In fact, the command
  135. builder is so smart that standard commands can be entered with just a
  136. single click of the mouse!  More complicated commands require at most
  137. three clicks of the mouse:  one on a command button, another on the
  138. direct object, and another on the indirect object.  The command builder
  139. is smart enough to supply any needed prepositions on its own.
  140.  
  141. The best thing about the command builder is that it is constantly
  142. aware of the state of the game.  Unlike the poor command builders
  143. found in other hybrid text/graphics systems, which are little more
  144. than gigantic lists of words offered with no knowledge of the game
  145. context, the TADS/Graphic command builder monitors the state of the
  146. game and offers useful default actions.  For example, if the user is
  147. pointing at a closed door, the command builder would offer "open door",
  148. and the user need only click on the right mouse button to open the door!
  149. If the door is already open, the command builder offers "close door".
  150. When the mouse is pointing at something that can be picked up, the
  151. command builder offers "take".  Don't worry, though -- the command
  152. builder won't give away any of your secrets.  As game author, you
  153. have complete control over the defaults that the command builder
  154. offers.
  155.  
  156. Of course, we haven't forgotten our text adventure roots.  For the
  157. die-hard text adventure fan, the full command parser that helped make
  158. TADS games so much fun is still available from the command line.  And,
  159. unlike some other hybrid text/graphics systems that had a mouse-based
  160. command builder slapped half-heartedly onto the text parser, TG is
  161. non-modal:  both the keyboard and the command builder are always active.
  162.  
  163. In addition, TG includes an extended version of ADV.T (called ADVG.T)
  164. which provides pre-implemented default graphical interface behavior for
  165. the basic adventure classes -- so TG brings the same advantages of
  166. object-oriented programming to graphical game design that TADS provided
  167. for text adventures.
  168.  
  169. TG provides a set of tools and intrinsic functions that let you integrate
  170. the graphical presentation with your game.  The programs that make up
  171. TADS/Graphic are:
  172.  
  173.   - The TADS/Graphic runtime (TRG).  This is the extended version of TR
  174.     that provides the new graphical intrinsic functions and a graphical
  175.     user interface.
  176.  
  177.   - The TADS/Graphic compiler (TCG).  This version of the TADS Compiler
  178.     reads not only your game source (.T) files, but also your TG resource
  179.     files.  This means that your game source and resource files are
  180.     *automatically* integrated by the compiler.
  181.  
  182.   - The TADS/Graphic Room Editor (TGE).  This resource editor allows
  183.     you to associate a picture with each room in your game, create and
  184.     modify "hot spots" (which associate a section of a picture with a
  185.     game object), and generate "overlays" (sections of a picture which
  186.     are separated into their own picture files, so that they can be
  187.     edited and changed independently of the main picture and later
  188.     displayed on top of the original picture, thereby changing the
  189.     picture as the state of the game changes).
  190.  
  191.   - The TADS/Graphic Icon Editor (TGI).  This resource editor allows
  192.     you to associate an icon with each item in the game that the player
  193.     can take and put in the inventory.  These icons are displayed in
  194.     the inventory window to help the player keep track of the objects
  195.     currently being carried.
  196.  
  197.  
  198. Can people play TADS/Graphic games without an EGA or VGA display?
  199. -----------------------------------------------------------------
  200.  
  201. One very interesting feature of TADS/Graphic is that the games you
  202. design with TG are supersets of the games you would design with TADS.
  203. As a result, you can run any TADS/Graphic game with the standard
  204. TADS run-time (and you don't even need to recompile)!  Therefore,
  205. in theory, people *can* play your games on a monochrome display, or on
  206. any other display, without any graphics.  (Note that playing a game
  207. with the standard text-mode TADS Runtime also removes the sound
  208. capability, even if a sound card is installed.)
  209.  
  210. Some cooperation from you, the game author, is required if your game
  211. is to be played without graphics.  There is nothing special you need to
  212. do during implementation -- the cooperation is required at the *design*
  213. level.  Specifically, you must take care that your game doesn't
  214. require the pictures -- no vital information should appear in the
  215. pictures that doesn't also appear in the accompanying text.  All
  216. this really means is that you must make sure that you faithfully
  217. describe anything important that appears in the pictures in the
  218. textual room descriptions.
  219.  
  220. Now, it's certainly not *required* that you make a game that's playable
  221. in pure text mode.  However, if you are interested in making all-text
  222. play possible, just keep text mode in mind while designing the game and
  223. writing the room descriptions.
  224.  
  225.  
  226. What do you need?
  227. -----------------
  228.  
  229. In addition to the TADS/Graphic package, you'll need tools to create
  230. sound effects, music, and pictures.  The TG package does *not* include
  231. any painting/drawing tools, music editors, or digitized sound recorders.
  232. Instead, TADS/Graphic reads files stored in specific standardized
  233. formats, so you can use any third-party tool that creates files in the
  234. appropriate formats.
  235.  
  236. Graphics:  TADS/Graphic reads 16- and 256-color PCX files.  (In addition,
  237. TGE creates overlay files in 256-color PCX format, and TRG reads them back
  238. in this same format.)  The picture that TADS/Graphic displays in the
  239. graphic window while in normal graphics mode is a 320 (horizontal) by 200
  240. (vertical) pixel pictures.  TRG will read 16- or 256-color pictures, but
  241. always converts the pictures to 16-color format for display; you should
  242. therefore draw pictures that use no more than 16 colors (but you can
  243. choose the 16 colors from the full VGA palette, and each picture can
  244. use a different palette).  We chose PCX format because it supports a full
  245. VGA palette, it provides flexible picture sizing, and nearly all PC paint
  246. and drawing programs can read and write PCX files.
  247.  
  248. Music:  TADS/Graphic plays SoundBlaster .CMF files.  You must have a
  249. music editing program that is capable of producing this format.  Note
  250. that you can convert files from a variety of other formats into .CMF
  251. files; for example, if your composition software saves files in the
  252. popular .ROL format (used by the AdLib card), you can use a conversion
  253. utility to generate a .CMF file from the .ROL data.  Several conversion
  254. tools are available free from the Creative Labs BBS and other on-line
  255. sources.
  256.  
  257. Sound Effects:  TADS/Graphic uses SoundBlaster .VOC files for
  258. digitized sound effects.  The SoundBlaster card comes with bundled
  259. software that allows you to create files in this format.  Note that
  260. you can generate a .VOC file from a variety of other digitized sound
  261. formats; for example, sound resources generated on a Macintosh can
  262. be easily converted to a .VOC file.  Several conversion tools are
  263. available free from the Creative Labs BBS and other on-line sources.
  264.  
  265. Text Editor:  As with TADS itself, you will need a text editor that
  266. produces plain ASCII files to prepare your source files.
  267.  
  268.  
  269. Getting Started
  270. ---------------
  271.  
  272. ** Step 1:  Design and start writing your game.
  273.  
  274. The first thing you need to do is to design your game just as you
  275. would a normal TADS game.  In fact, there are very few differences
  276. between writing the .T file describing a normal text-only TADS game
  277. and a TADS/Graphic game.  Practically the only difference is that
  278. you should use the single-quoted string property gp_name instead of
  279. sdesc whenever you define an object that can either be taken or will
  280. appear in a room's picture.
  281.  
  282.    (Why?  Because the command builder needs to know the name of
  283.     an object when the player places the mouse over it.
  284.     What about the sdesc?  You don't need one if you define gp_name!
  285.     ADVG.T defines sdesc = { say(self.gp_name); } for all objects.
  286.     But, you can *also* define an sdesc if you want -- if you define
  287.     your own, it will override the default, so you can make the
  288.     name that shows up in the command builder different from the
  289.     sdesc if you want.)
  290.  
  291. Note that you should #include the graphical versions of the
  292. standard files.  Use ADVG.T instead of ADV.T, and use STDG.T
  293. instead of STD.T.
  294.  
  295. ** Step 2:  Add icons for movable objects.
  296.  
  297. The next thing you need to do is to provide an icon for each object
  298. that can be picked up by the player.  The icon is displayed in the
  299. inventory window when the player is carrying the associated object.
  300. Using the icon editor is quite simple.  If your game's main .T file
  301. is called SAMPLE.T, call your icon resource file SAMPLE.TI.  Run
  302. the icon editor like this to create or edit the file:
  303.  
  304.     tgi sample.ti
  305.  
  306. This brings up a screen that shows a list of objects (empty if you're
  307. starting a new .TI file) and an icon.  To create a new icon, click
  308. on the "New" button and enter an object name -- this is the object
  309. defined in your .T file with which you want to associate the icon.
  310.  
  311.    (If you've used resource managers for other systems, it might be
  312.     occurring to you now just how nice TADS/Graphic programming is
  313.     going to be in comparison.  Did you notice that the icon has a
  314.     *name*, not a number?  You'll notice soon that this operation --
  315.     naming the icon in the .TI file -- is the *only* thing you have
  316.     to do to associate the icon with the object.  You won't need to
  317.     make any corresponding entry in your .T file -- the compiler will
  318.     automatically add the necessary information to the TADS object when
  319.     you compile your game!  No, the compiler doesn't modify your .T
  320.     file -- it just stores the icon information for the object in the
  321.     .GAM file.)
  322.  
  323. Now you can turn pixels on and off in the big icon picture at the
  324. top of the screen.  Clicking the mouse inverts a pixel; holding
  325. down the button and moving the mouse around keeps changing pixels
  326. to the color to which you changed the first pixel.  The icon editor
  327. is pretty simple and primitive - that's pretty much all it does.
  328.  
  329. ** Step 3:  Draw your room pictures.
  330.  
  331. This step is easy for us to say, and time consuming for you to do.
  332. Start up your favorite paint program and draw a 320 x 200 picture
  333. depicting the first room in your game.  Save the picture in PCX
  334. format.  Rinse.  Repeat for each room in your game.
  335.  
  336. Note that you should be careful not to use more than 16 different
  337. colors in your pictures, because the TADS/Graphic run-time runs in
  338. the EGA and VGA 16-color modes.  The Super VGA 640 x 480 256-color
  339. modes are too slow and non-standardized for us to support them at
  340. the moment.  However, you can choose your 16 colors from the full
  341. VGA palette.
  342.  
  343.    (You don't have to worry about making the pictures perfect
  344.     right now, because you can go back and edit the pictures
  345.     at any time.  There's no point where you have to "import"
  346.     the pictures into TG -- the pictures are automatically read
  347.     from the .PCX files while the game is actually running.  So,
  348.     when you change a picture, you don't even need to recompile
  349.     your game.  Note, however, that you may have to adjust the
  350.     hot spots defined for a picture; hot spots are describe more
  351.     fully later.)
  352.  
  353. ** Step 4:  Add the pictures to the game.
  354.  
  355. Now it's time to create the Room resource file.  This is similar to
  356. the Icon resource file; you use the TADS/Graphic Room Editor, TGE,
  357. to operate on this file.  Call it SAMPLE.TG, and create and edit it
  358. like this:
  359.  
  360.     tge sample.tg
  361.  
  362. This brings up a screen very similar to the Icon Editor screen,
  363. but a bit more complicated.  On the top of the screen is a blank
  364. area -- TGE will use this area to display the current room's picture.
  365. On the bottom you'll see two list boxes.  The first is a list of
  366. rooms, and the second is a list of "regions" within the current room.
  367. There are also some buttons for creating overlays.
  368.  
  369. Now, associate a picture with each room.  Click on the "New"
  370. button.  Enter the object name for a room (this is the same name
  371. that you use in your .T file when defining the room object), and
  372. enter the name of a .PCX file that you want to associate with the
  373. room.  As with the icon editor, this is the only thing you need to
  374. do to associate a picture with the room -- the TADS/Graphic Compiler
  375. automatically adds the necessary information to your .GAM file, so
  376. you don't need to manually add anything to your .T file to tell
  377. the system what picture to use.
  378.  
  379. ** Step 5:  Compile the game.
  380.  
  381. This is easy:  just use TCG as though it were TC.  TCG takes all
  382. of the same options as TC.  For the simple case, all you'd have to
  383. do is something like this:
  384.  
  385.     tcg sample
  386.  
  387. Note that TCG automatically derives the resource filenames from
  388. your source filename.  So, when you compile SAMPLE.T, the compiler
  389. will look for SAMPLE.TI and SAMPLE.TG in the same directory as
  390. SAMPLE.T.  If the compiler can't find the resource files, it will
  391. display a warning.  In addition, if your resource files refer to
  392. objects that aren't defined in your .T file, the compiler will
  393. issue a warning message.  Note, however, that there's no warning
  394. for *failing* to provide an icon or picture for an object, because
  395. the compiler doesn't have any good way to know if an object should
  396. have resource data or not -- it's up to you to make sure that each
  397. object has the necessary resource associations.
  398.  
  399. ** Step 6:  Run the game.
  400.  
  401. Use TRG to execute the game:
  402.  
  403.     trg sample
  404.  
  405. The TADS/Graphic interface will come up, and your game should display
  406. its introductory text and display the first room's picture.
  407.  
  408.  
  409. Going Further -- Regions
  410. ------------------------
  411.  
  412. So far, we've just made an illustrated text adventure.  The pictures
  413. that you defined for your rooms don't do anything -- they just sit
  414. there making the game prettier.  However, TADS/Graphic lets you do
  415. much more with your pictures:  you can change a picture's appearance
  416. as things depicted in the picture change; and you can make the picture
  417. active, so that the player can do things to objects in the picture
  418. simply by pointing at them with the mouse.  This is all accomplished
  419. through "regions."
  420.  
  421. A region, or "hot spot," is a rectangular area of a picture that you
  422. associate with a game object.  For example, a picture might depict
  423. a shelf; you could define a rectangular area around the picture of
  424. the shelf to be associated with an object in your .T file called
  425. "shelves".  This assocation is made with the Room Editor.
  426.  
  427. First, bring up TGE with your room resource file.  Select the room
  428. containing the shelves by clicking on its name in the room list;
  429. this will select the room and display its picture.  Now, go over
  430. to the region list, and click on the "New" button.  The mouse will
  431. immediately change to crosshairs and move to the picture area.
  432. Drag the mouse over the rectangular area you wish to associate
  433. with the "shelves" object:  move the mouse to the upper left,
  434. click and hold down the mouse button, move to the lower right
  435. while still holding down the button, then release the button.
  436. A highlighted rectangle will appear over the area you defined.
  437. Now the system will ask you to enter the name of the object you're
  438. associating with the region.
  439.  
  440. You can move and resize the rectangle for a region at any time.
  441. First select a region by clicking on its name in the region list.
  442. Move the rectangle by clicking in the middle of it, holding down
  443. the mouse while dragging the rectangle to its new location, and
  444. releasing the mouse.  Resize the rectangle by dragging its lower
  445. right corner.
  446.  
  447. Now you can recompile and run your game.  When you go into the
  448. room with the hot spot, and move the mouse over the hot spot,
  449. the command builder window should automatically show a default
  450. command for the shelves!  You can execute the default command by
  451. clicking the right mouse button.  You can simply select the object
  452. for another command by clicking the left mouse button -- then you
  453. can click on a verb button to execute a different verb on the
  454. object.
  455.  
  456.  
  457. Going Further Still -- Overlays
  458. -------------------------------
  459.  
  460. The next step in writing your game is to make your pictures change
  461. in response to the player's actions.  For example, when the player
  462. picks up an object shown in a picture, the object should be removed
  463. from the picture.  Or, when the player opens a door, the picture
  464. should reflect the change.
  465.  
  466. The first thing to do is to make a hot spot for the area to be
  467. changed, as described earlier.  Select the hot spot by clicking on
  468. its name in the region list.  Now, click on the overlay button that
  469. matches the type of region:
  470.  
  471.    Item     -  something on the screen that should go away when
  472.                the user picks it up
  473.  
  474.    Openable -  something that should change when the user opens
  475.                and closes it
  476.  
  477.    Other    -  any other type of changing picture area
  478.  
  479. The editor will ask you for a picture filename.  Enter just the *root*
  480. filename:  seven letters or fewer.  The reason you enter just seven
  481. letters is that the editor is going to create two files whose names
  482. are formed by appending some more letters to the filename root you
  483. provide:
  484.  
  485.    Item     -  <rootname>T.PCX for the "taken" (object not present) overlay
  486.                <rootname>D.PCX for the "dropped" (object present) overlay
  487.  
  488.    Openable -  <rootname>O.PCX for the "open" overlay
  489.                <rootname>C.PCX for the "closed" overlay
  490.  
  491.    Other    -  <rootname>1.PCX and <rootname>2.PCX, to be used according
  492.                to your needs
  493.  
  494. The editor will create the files by writing a small picture containing
  495. only the area contained in the region rectangle.
  496.  
  497. After you've created the necessary overlay files, exit TGE and start
  498. your favorite paint program.  For each overlay, you'll probably only
  499. need to change *one* of the two overlay files -- the other is simply
  500. used to restore the original information if you want to remove an
  501. overlay.
  502.  
  503. NOTE 1:  Your paint program *must* be able to store the .PCX file in
  504. its original size.  Some paint programs instead store the .PCX file
  505. in full-screen size.
  506.  
  507. NOTE 2:  When defining an overlay for an item that can be taken,
  508. you must draw the original room picture with the item *missing*,
  509. and add the item to the <rootname>D.PCX overlay picture.  The
  510. reason is that TADS/Graphic applies item overlays according to
  511. the objects that are actually present in a room.  So, while an
  512. object is present in its original location, the <rootname>D.PCX
  513. is drawn.  When an object is first taken, the <rootname>T.PCX
  514. overlay is applied.  However, once an object is gone, and the
  515. player enters the room later, no overlay at all will be applied!
  516. Since overlays are applied according to a room's contents, an
  517. overlay can't be applied for an object once it's been removed.
  518. Hence, you must draw each room as it will look after all items
  519. that can be removed have been removed.
  520.  
  521.  
  522. Command Builder Interface
  523. -------------------------
  524.  
  525. The TADS/Graphic command builder achieves its exceptional integration
  526. with the game using a mechanism very similar to the interface between
  527. the regular TADS command parser and a game.  The command builder uses
  528. a series of special properties provided by the objects in your game
  529. program to determine what types of commands to build.
  530.  
  531. The first thing that the command builder needs to know is which objects
  532. are in a room.  This information is available from the hot spot data
  533. that you create with the Room Editor.  When the compiler reads your game
  534. program, it adds the hot spot information from the room editor resource
  535. file (the .TG file) to each room in your game.  The TADS/Graphic Run-time
  536. reads this information each time the player enters a new room, and makes
  537. it the "current" hot spot list.
  538.  
  539. The run-time now has a list of regions on the screen and objects to which
  540. those regions correspond.  When the player moves the mouse over one of
  541. these regions, the run-time system checks a number of properties in the
  542. object, and builds a command based on that information.
  543.  
  544. First, the run-time calls the object's gp_active method.  This method
  545. returns true or nil, indicating whether the object's hot spot should be
  546. considered active by the command builder.  If gp_active is nil, the
  547. command builder ignores the hot spot, and no command is built for the
  548. object.  If gp_active is true, the command building process continues.
  549.  
  550. Next, the command builder evaluates the object's gp_name property.  This
  551. property returns a (single-quoted) string indicating the name of the
  552. object as it should be entered in a command.  This should include any
  553. adjectives and nouns needed to identify the object uniquely within the
  554. game.
  555.  
  556. Next, depending on the current command building state, the properties
  557. gp_defverb and gp_defverb2 are evaluated.  These properties return strings
  558. indicating the default verbs that should be applied to the object.  The
  559. property gp_defverb returns the default single-object verb to be applied
  560. to the object (a single-object verb is a verb that takes only a direct
  561. object, and no indirect object).  The property gp_defverb2 returns either
  562. nil or the default two-object verb of which the object is the indirect
  563. object.  If gp_defverb2 returns a non-nil value, it takes precedence
  564. over gp_defverb.
  565.  
  566. For example, if a simple item that appears in a picture would normally
  567. return gp_defverb = 'take' and gp_defverb2 = nil.  This means that the
  568. default command for the object is "take item".  A simple fixed item that
  569. appears in a picture would normally return gp_defverb = 'examine' and
  570. gp_defverb2 = nil.
  571.  
  572. A fixed item that is also an openable would return gp_defverb = 'open'
  573. if the object is closed, and gp_defverb = 'close' if the object is open.
  574. It may also be desirable to return gp_defverb2 = 'put in' when the object
  575. is open, because it can act as a container.  When gp_defverb2 returns
  576. 'put in' rather than nil, the gp_defverb value is ignored, and the
  577. default command for the object is "put _____ in item".  The blank can
  578. then be filled in by the player by selecting a second object (such as
  579. an item in the inventory window).
  580.  
  581. As with most things in TADS, a suitable set of command builder properties
  582. is inherited by most objects.  You'll only need to provide your own
  583. overriding definitions for gp_defverb and gp_defverb2 when you create a
  584. new kind of object.
  585.  
  586. Note that gp_name should be used in place of sdesc when defining objects
  587. in a TADS/Graphic game.  The base class thing in advg.t provides a definition
  588. for sdesc = { say(self.gp_name); }, so you do not need to provide an sdesc
  589. for an object unless it differs from the gp_name.
  590.  
  591.  
  592. New Built-in Functions
  593. ----------------------
  594.  
  595. g_readpic(filename).  The filename is a (single-quoted) string giving the
  596. name of a PCX file.  This file is read into a "staging area" that holds
  597. the current room picture under construction.  The display is *not* changed
  598. by g_readpic; you must call g_showpic to display the current picture.
  599. No return value.
  600.  
  601. g_showpic().  Displays the current picture, replacing whatever is
  602. currently displayed in the picture area (or the entire screen, if in
  603. title mode).  Sets the palette for the new picture prior to displaying
  604. the picture.  No return value.
  605.  
  606. g_sethot(hotlist).  Sets the current room's hot list data.  This will
  607. almost never be called except by the low-level room entry functions
  608. in advg.t; the only valid argument for this function is the value of
  609. a gp_hotlist property inserted into a room by the compiler based on
  610. information in the room resource (.TG) file.  No return value.
  611.  
  612. g_inventory(nil).  Clears the entire inventory window.  No return value.
  613.  
  614. g_inventory(obj, in_inventory).  Adds or removes obj from the inventory
  615. window.  If in_inventory is true, the object is added (but the call is
  616. ignored if the object is already present -- an object can't appear in the
  617. inventory window twice); if in_inventory is nil, the object is removed
  618. (but the call is ignored if the object is not in the inventory window).
  619. Note that this function will not normally be needed by a game program
  620. except in the low-level functions in advg.t, since the normal inventory
  621. management routines in advg.t keep the inventory window synchronized
  622. with the game under most circumstances.  You'll only need to code
  623. calls to this routine explicitly when you do something that circumvents
  624. the normal inventory management routines.  No return value.
  625.  
  626. g_compass(direction, enabled).  The direction is a number:  1 = North,
  627. 2 = Northeast, 3 = East, and so forth around the compass clockwise, through
  628. 8 = Northwest; 9 = Up, and 10 = Down.  If enabled is true, the given
  629. compass point button is enabled (that is, the button is turned white, and
  630. may be selected by the player).  If enabled is nil, the given button is
  631. disabled (it is turned gray, and clicking on the button with the mouse
  632. has no effect).  There is no return value.
  633.  
  634. g_compass(direction_list, enabled).  The direction_list is a list of
  635. numbers corresponding to the compass direction buttons as described
  636. above.  The buttons indicated in the list are enabled or disabled
  637. according to the value of enabled, and in addition, all of the compass
  638. buttons *not* in the list are set to the opposite value.  For example,
  639. g_compass([1 3 5 7], true) enables north, east, south, and west, and
  640. disabled northeast, southeast, northwest, southwest, up, and down.
  641. This form of the call allows the entire compass to be set up with a
  642. single call.  Note that the single-button form can be used after
  643. a list call to further modify individual buttons.  This function returns
  644. no value.
  645.  
  646. g_overlay(filename, x, y).  Reads the PCX file given by the (single-quoted)
  647. string filename, and writes the contents of the file over the current
  648. room picture starting at the given (x,y) coordinates.  Note that this
  649. function does *not* change the display -- it simply modifies the current
  650. room picture under construction.  You must call g_showpic() after all
  651. overlays have been applied to change the display.  This function returns
  652. no value.
  653.  
  654. g_mode(mode).  Sets a display mode.  The display is immediately changed
  655. to the selected mode.  No value is returned.  The valid values of mode are:
  656.  
  657.   1   Normal game mode.  The display is put into 640 x 480 x 16 mode
  658.       (640 x 350 x 16 on EGA).  The top left quadrant of the screen
  659.       displays the room picture; the top right quadrant displays the
  660.       controls (command buttons, compass, inventory window, command
  661.       builder window).  The bottom half of the screen is devoted to
  662.       the text window.  This is the mode for normal interactive game
  663.       play.
  664.  
  665.   2   Title mode.  The display is changed to 320 x 200 x 256 mode
  666.       (VGA only - no effect on EGA).  The entire screen is devoted
  667.       to the current picture.  This mode can be used to display
  668.       titles and special sequences, but note that no interaction
  669.       is supported in this mode.
  670.  
  671. g_music(filename).  The CMF file indicated by the (single-quoted) string
  672. filename is read into the music buffer, and becomes the currently active
  673. music track.  The music is played continuously in the background until
  674. another call to g_music().  Any music previously playing is stopped and
  675. replaced with the new music file.  There is no return value.
  676.  
  677. g_sound(filename).  The VOC file indicated by the (single-quoted) string
  678. filename is read and played.  The sound file must be less than 64k long.
  679. There is no return value.  This function does not return until the
  680. digitized sound has finished playing.  If any music is currently playing,
  681. the music will continue while the digitized sound plays.
  682.  
  683. g_pause(delay).  Pauses for the indicated delay, which is a number
  684. specifying hundredths of seconds (to pause for 5 seconds, use a delay
  685. value of 500).  If the user hits a key or clicks the mouse during the
  686. delay interval, the delay is immediately ended (this allows players
  687. to skip ahead during title or special sequences that they've already
  688. seen or have finished looking at before the alloted delay).  There
  689. is no return value.
  690.  
  691. g_effect(num).  Applies a special display effect.  There is no return
  692. value.  The effect is applied immediately.  These effects are intended
  693. to be applied in title mode (g_mode(2)) only, because they apply to the
  694. entire display.  The valid values of num are:
  695.  
  696.   1   Fade in from black to current picture.  The display is set to
  697.       an all-black palette, the current picture (read with g_readpic
  698.       and possibly modified with g_overlay) is displayed, then the
  699.       palette is gradually changed from all black to the current
  700.       picture's palette.
  701.  
  702.   2   Fade from current picture to black.  Reverses the effect of 1.
  703.  
  704.   3   Fade in from white to current picture.  Similar to 1, starting
  705.       with an all-white screen.
  706.  
  707.   4   Fade from current picture to white.  Reverses the effect of 3.
  708.  
  709.  14   Dissolve into new picture.  The picture currently on the screen
  710.       is gradually replaced with the picture in the staging area (read
  711.       with g_readpic and possibly modified with g_overlay).  The palette
  712.       is *not* changed during the transition, so the two pictures must
  713.       share a common palette.
  714.  
  715.  
  716. New System-Defined Properties
  717. -----------------------------
  718.  
  719. gp_name:  returns a single-quoted string value indicating the name of
  720. an object to be used by the command builder.
  721.  
  722. gp_defverb:  returns a single-quoted string value indicating the default
  723. single-object (i.e., direct object only) verb to be offered when the
  724. object is selected with the mouse.
  725.  
  726. gp_defverb2:  returns a single-quoted string value indicating the default
  727. two-object verb to be offered, with this object as indirect object, when
  728. the object is selected with the mouse.  Returns nil if there is no default
  729. two-object verb.
  730.  
  731. gp_defprep(verb):  verb is a single-quoted string indicating a verb under
  732. consideration by the command builder.  Returns a single-quoted string
  733. indicating the default preposition that should be applied if this object
  734. is to be used as the indirect object of this verb.  For example, a surface
  735. would return 'on' if the verb were 'put', whereas a container would
  736. return 'in'.  This property should simply return nil if the object
  737. doesn't make sense as the indirect object of the verb.
  738.  
  739. gp_active:  returns true if the hot spot corresponding to the object should
  740. be considered active by the command builder, nil otherwise.
  741.  
  742. gp_hotlist:  this property is set by the compiler during integration of
  743. the room resource (.TG) file.  This property should not be set by your
  744. code.
  745.  
  746. gp_icon:  this property is set by the compiler during the integration
  747. of the icon resource (.TI) file.  This property should not be set by
  748. your code.  The value of this property is used by the run-time system
  749. to extract the icon to be displayed in the inventory window for the
  750. object.
  751.  
  752. gp_hotid:  this property is set by the compiler during integration
  753. of the room resource (.TG) file.  Your code should not set this
  754. property.  The property is set for each object used in a hot spot
  755. to identify the hot spot.  The value is a list.  The first element
  756. is the room object with which the hot spot is associated.  The second
  757. element is the index within the room's gp_hotlist data of the hot
  758. spot information for this object.  This property is not currently
  759. used, but may be used by future intrinsics.
  760.  
  761. gp_overlay:  this property is set by the compiler during integration
  762. of the room resource (.TG) file.  It should not be set by your code.
  763. This property contains a single-quoted string value that gives the
  764. prefix name of the PCX file containing the overlay for the object.
  765. This is simply the prefix name that you enter with the "create overlay"
  766. dialog box in the room editor.  This information can be used by your
  767. game program to load the various overlay files associated with the
  768. object, without having to include the actual name of the file in
  769. your game (this feature is used by advg.t, for example, to provide a
  770. simple mechanism for applying overlays when objects are opened and
  771. closed, or taken, without any coding in your game).
  772.  
  773. gp_hotx and gp_hoty:  set by the compiler during integration of
  774. the room resource (.TG) file.  These properties provide the (x,y)
  775. coordinates of the overlay corresponding to the object.  Used in
  776. conjunction with gp_overlay to apply the overlays for an object
  777. to the room picture.
  778.  
  779.  
  780. Questions and Answers
  781. ---------------------
  782.  
  783. - Okay, how many colors do I *really* have?
  784.  
  785. You really have 16 colors, but two of them are reserved:  you
  786. must always have one color that is pure black, and another that
  787. is pure white.  So, your pictures are composed of 14 colors that
  788. are entirely of your choosing (the system doesn't care at all
  789. what these other colors are), plus 2 fixed colors:  black and
  790. white.  The system reserves black and white so that it can draw
  791. the control panel area consistently for every room, regardless
  792. of the palette for any particular room.  The disadvantage of this
  793. is that you get only 14 colors you can truly choose; the advantage
  794. is that every room can have its own unique palette without having
  795. the controls change in every room.
  796.  
  797.  
  798. - Why are the icons monochrome?
  799.  
  800. The icons (and, in fact, the entire control panel area) is
  801. monochrome so that we didn't have to either reserve a bunch of
  802. colors for the control panel, or make the control panel keep
  803. changing colors every time the room picture palette changes.
  804. The TADS/Graphic system demands that black and white are always
  805. in the palette.  Since the icons are displayed independently of
  806. the rooms, and it's undesirable for the icons to change colors
  807. every time the player enters a new room, the icons must be drawn
  808. with the fixed, room-independent colors:  black and white.
  809.  
  810.  
  811. - Can I define multiple icons for a single object?  For example,
  812.   I want to depict a box differently when it's opened and when it's
  813.   closed.
  814.  
  815. You can't do this directly, because the icon editor allows only
  816. a single icon to be associated with each object.  However, you can
  817. define a dummy object in your game whose only purpose is to hold
  818. icon data in its gp_icon property, and then assign this icon data
  819. to the object whose icon you want to change.  For example, let's
  820. assume you've defined a dummy object named box_open_icon_holder,
  821. and associated the opened version of the icon with this object;
  822. then, in your box's doOpen routine, you could do this:
  823.  
  824.      self.closed_icon := self.gp_icon;   // save icon when I'm closed
  825.      self.gp_icon := box_open_icon_holder.gp_icon;  // switch icons
  826.      if (self.isIn(Me) and self.isVisible(Me))
  827.      {
  828.         g_inventory(self, nil);     // remove my icon from inventory window...
  829.         g_inventory(self, true);    // ... and add it back to ensure refresh
  830.      }
  831.  
  832. Likewise, your doClose method would do this to restore the original icon:
  833.  
  834.      self.gp_icon := self.closed_icon;   // restore closed icon
  835.      if (self.isIn(Me) and self.isVisible(Me))
  836.      {
  837.         g_inventory(self, nil);     // remove my icon from inventory window...
  838.         g_inventory(self, true);    // ... and add it back to ensure refresh
  839.      }
  840.  
  841.  
  842. - How can I have multiple hot spots for a single object?  How about
  843.   multiple overlays?  For example:  I want to have a ladder start off
  844.   in one room (so it needs an overlay and hot spot there), but I want
  845.   the player to be able to pick it up and carry it to another room,
  846.   where it will need another overlay and hot spot.
  847.  
  848. Things won't work properly if you try to define two hot spots for the
  849. same object, thanks to the one-to-one relationship between hot spots
  850. and game objects.  You'll need to use another trick like the one that
  851. lets you create multiple icons per (apparent) object, described above.
  852.  
  853. For example, suppose you want to use the ladder to climb up to a hole
  854. in the ceiling, and let's say that the command needed is simply "drop
  855. ladder" in the appropriate room.  You could write a doDrop method for
  856. the ladder that checks to see if the player is in the special location
  857. with the hole in the ceiling, and if so, switch the original ladder
  858. with a second ladder object.
  859.  
  860. Note that, unlike the icon switch method, you'd actually switch the
  861. object itself rather than just some property of the object.  The
  862. ladder.doDrop method might look like this:
  863.  
  864.    doDrop(actor) =
  865.    {
  866.      if (actor.location = holeRoom)
  867.      {
  868.        "%You% put the ladder under the hole.  It looks like
  869.        %you%'ll be able to reach the hole easily now.";
  870.        self.moveInto(nil);   /* to make sure overlay is displayed */
  871.        ladder2.ismoved := nil;
  872.        ladder2.moveInto(actor.location);
  873.      }
  874.      else pass doDrop;  /* use default doDrop anywhere else */
  875.    }
  876.  
  877. Note that the moveInto routine in advg.t will take care of displaying
  878. the picture of the new ladder object in its new location.  This is done
  879. automatically because ladder2 has never been taken (whenever an object
  880. is picked up, its property ismoved is set to true; by setting ismoved
  881. to nil before calling moveInto, we ensure that moveInto knows that the
  882. ladder is being moved back into its original location).
  883.  
  884. Note that you'll have to also define a doTake method in ladder2 that
  885. undoes these changes.  All it needs to do is restore the original
  886. ladder to the player's inventory; ladder2.doTake might look like this:
  887.  
  888.    doTake(actor) =
  889.    {
  890.      "Taken.";
  891.      self.moveInto(nil);  /* automatically removes ladder from picture */
  892.      ladder2.moveInto(actor); /* automatically updates inventory window */
  893.    }
  894.  
  895. You can use similar tricks for a multitude of effects requiring the same
  896. object to have multiple icons, hot spots, or overlays.
  897.  
  898.  
  899. - That's all well and good, but what about the more general case?  What
  900.   if the player picks up an object in one room, and drops it in another
  901.   room?  What will the system display in the new room?
  902.  
  903. Simple:  nothing.  The only way to make an object show up in a room
  904. is to draw an overlay for it in that room, and associate that overlay
  905. with that object's hot spot.  If the player drops an object in the room
  906. where it started, the original overlay for the object in that room will
  907. be redisplayed.  If the player drops an object in another room, unless
  908. you've specially set up another picture of the object in its new room
  909. as described above, the object will simply not appear anywhere in the
  910. picture.  Of course, it will still appear in the textual description
  911. of the room, so it doesn't disappear from the game entirely; and the
  912. player can still manipulate it with typed commands (but not with the
  913. mouse or the command builder, since there's nothing to point to).
  914.  
  915.  
  916. - Why don't you display the object's icon, or make a "generic" overlay
  917.   for each object that's displayed whenever it's in a non-default
  918.   location?
  919.  
  920. Because it would look stupid.
  921.  
  922.  
  923. - But wouldn't that be better than removing it from the picture
  924.   altogether?
  925.  
  926. Not at all.  Here's my question:  why would the player ever need to drop
  927. anything in general, when there's nothing to be gained by doing so?  (I'm
  928. not talking about situations like dropping the ladder under the hole --
  929. that's covered by explicit extra programming to handle the object being
  930. dropped in a special context, which you'd want anyway even if the system
  931. did have some sort of general object depiction capability.  I'm just
  932. talking about randomly dropping an object in a location where it will
  933. do no particular good.)  Well?
  934.  
  935.  
  936. - Lots of reasons!  First, what if the player is carrying too much
  937.   stuff and wants to drop something?  Or, maybe the player is going
  938.   through the game trying to find weaknesses in the interface so they
  939.   can post flames all over usenet!
  940.  
  941. For the first situation, it's easy:  get rid of the inventory bulk
  942. and weight limits.  There's no good reason for these except that lots
  943. of text adventures have them.  Inventory management in general just
  944. isn't that interesting a puzzle; when you want to create some specific
  945. inventory management puzzle (such as:  you can't get the xenite crystals
  946. too close to the radioactive frobnezium rods, so you can't carry them
  947. both at the same time unless the frobnezium is in the lead box), you
  948. can set things up so that either there's a good place to deposit one
  949. of the objects (so you program in a special case as with the ladder),
  950. or there's some solution other than dropping objects (such as a lead
  951. box to shield the xenite from the deadly M-rays).  Note that the default
  952. basicMe weight and bulk limits have been raised to absurd new highs
  953. to prevent any need for the player to think about inventory management.
  954. You can change them back if you want, but why would you want to?
  955.  
  956. For the second, who cares?  A determined detractor will find lots of
  957. problems with your game no matter how thorough you are.  Your workload
  958. for writing a graphical game is going to be sufficiently high that it's
  959. not worth the effort to address issues that don't add to the playability.
  960.  
  961. Realism isn't the highest goal in writing a game -- playability is.
  962. Games are supposed to be fun!  Is chess realistic?  Is poker realistic?
  963. Is any adventure game you've ever played realistic?  Of course not.
  964. It's not a tractible problem to make a realistic game, and if you did
  965. there's no reason to think it would be all that much fun anyway.
  966.  
  967. If you don't give players a reason to drop objects, very few of them
  968. will ever try to drop objects.  Those that do will discover a minor
  969. limitation of the game.  In fact, you might even want to simply make it
  970. impossible to drop objects by turning off the generic "drop" command
  971. altogether.  You'll notice there's not even a "drop" button on the
  972. main control panel.
  973.  
  974.